﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FineUI;
using Maticsoft.BLL;
using Maticsoft.Model;

namespace FineUI.Examples
{
    public partial class student_query_socre : System.Web.UI.Page
    {
        protected DataSet LoadStuDocment()
        {
            string currentS_Id = Session["UserName"].ToString();
            Maticsoft.BLL.Teacher Teacher = new Maticsoft.BLL.Teacher();
            DataSet DSStudentCourseInform = Teacher.GetReportSubmitInformation("ReportSubmit.T_Id=Teacher.T_Id and ReportSubmit.S_Id=Student.S_Id and Student.S_Id= '" + currentS_Id + "'");

            DataView DSView = DSStudentCourseInform.Tables[0].DefaultView;
            Grid1.DataSource = DSView;
            Grid1.DataBind();

            return DSStudentCourseInform;

        }

        protected void ExistsPermiss(string P_Id, string P_Status)
        {
            Maticsoft.BLL.Permissions PM = new Maticsoft.BLL.Permissions();
            if (!PM.ExistsPermiss(P_Id, P_Status))
            {
                Response.Redirect("~/user_no_permission.aspx");
            }

        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Redirect("~/login.aspx");
                return;
            }
            ExistsPermiss("S006", "已授权");
            LoadStuDocment();
        }

        protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
        {

            Grid1.PageIndex = e.NewPageIndex;
            LoadStuDocment();

        }
    }
}